package User;

import com.sram.entity.User;
import com.sram.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2017/3/15.
 */
@RunWith(SpringJUnit4ClassRunner.class)     //表示继承了SpringJUnit4ClassRunner类
@ContextConfiguration(locations = {"classpath:spring-hibernate.xml"})
public class userTestController {
    @Resource
    private UserService userService;
    @Test
    public void test() throws Exception {
        System.out.println("test...start...........");
        //查询
        User user =new User("杜浩","1234");
        userService.add(user);
        System.out.println("test......end........");
    }
}
